package homeworkplus.day02;

import java.util.Scanner;

/**
 * @Classname: Test06
 * @Author: bromide
 * @CreateTime: 2022/3/30--8:57
 * @Version: V1.0
 * @Desciption: 测试正则表达式，并尝试编写规则: 电话号码可能有3-4位区号，
 * 7-8位号码:0415-5561111
 */
public class Test06 {
    public static void main(String[] args) {
        String regex = "\\d{3,4}-\\d{7,8}";
        Scanner scanner = new Scanner(System.in);
        String phoneNumber = scanner.nextLine();
        if (phoneNumber.matches(regex)) {
            System.out.println("是电话号码");
        } else {
            System.out.println("不是电话号码");
        }
    }
}
